------------------------------------------------------------------------------------------------------------------------------------
--[[

    蜜蜂、蝴蝶的采蜜组件
    

]]--
------------------------------------------------------------------------------------------------------------------------------------



AddComponentPostInit("pollinator", function(self)


    local old_Pollinate = self.Pollinate
    self.Pollinate = function(self,flower,...)
        local old_picked_flowers = {}
        for _,temp_flower in pairs(self.flowers) do
            old_picked_flowers[temp_flower] = true
        end
        local origin_ret = {old_Pollinate(self,flower,...)}
        for k, temp_flower in pairs(self.flowers) do
            if not old_picked_flowers[temp_flower] then
               temp_flower:PushEvent("hutao_event.pollinator.pollinated",{doer = self.inst}) 
            end
        end
        return unpack(origin_ret)
    end

end)